import { createApp } from 'vue';
import pinia from '/@/stores/index';
import App from './App.vue';
import router from './router';
import { directive } from '/@/utils/directive';
import { i18n } from '/@/i18n/index';
import other from '/@/utils/other';
import echarts from '/@/utils/echarts';
import '/@/theme/js/iconfont';

import ElementPlus from 'element-plus';
import 'element-plus/dist/index.css';
import '/@/theme/index.scss';
import mitt from 'mitt';
import VueGridLayout from 'vue-grid-layout';
import OrganizeTreeSelect from '/@/components/OrganizeTreeSelect/index.vue'
import Lumenim from '/@/views/chat/components/message/index.js'
// 聊天模块全局组件
import { MainMixin } from '/@/views/chat/mixins/main-mixin.js'
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
import 'font-awesome/css/font-awesome.min.css'

// 工作流全局组件
import WDialog from '/@/views/setting/workflow/common/WDialog.vue'
import Tip from '/@/views/setting/workflow/common/Tip.vue'
import Ellipsis from '/@/views/setting/workflow/common/Ellipsis.vue'
import Avatar from '/@/views/setting/workflow/common/Avatar.vue'
import Icon from '/@/views/setting/workflow/common/Icon.vue'

const app = createApp(App);

window.$vueApp = app

directive(app);
other.elSvg(app);
app.component('OrganizeTreeSelect', OrganizeTreeSelect)
app.component('FontAwesomeIcon', FontAwesomeIcon)
app.component('WDialog', WDialog)
app.component('Tip', Tip)
app.component('Ellipsis', Ellipsis)
app.component('Avatar', Avatar)
app.component('Icon', Icon)
app.mixin(MainMixin)
// 全局挂载 echarts
app.config.globalProperties.$echarts = echarts;

app.use(pinia).use(router).use(ElementPlus, { i18n: i18n.global.t }).use(i18n).use(VueGridLayout).use(Lumenim).mount('#app');

app.config.globalProperties.mittBus = mitt();


